﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GroupList.aspx.cs" Inherits="DirectoryWeb.GroupList" CodePage="932" %>

<!DOCTYPE html>

<script src="Scripts/directory.js" type="text/javascript"></script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
      <table>
        <tr>
          <td>一覧</td>
          <td align="right"><asp:Label ID="CountLabel" runat="server"></asp:Label>
          </td>
          <td style="width:10px"></td>
          <td>詳細</td>
        </tr>
        <tr>
          <td colspan="2" valign="top">
            <asp:UpdatePanel ID="GroupUpdatePanel" runat="server" UpdateMode="Conditional" RenderMode="Inline">
              <ContentTemplate>
                <asp:ListBox ID="GroupListBox" runat="server" AutoPostBack="True" Rows="16" TabIndex="1" 
                  DataSourceID="GroupsDataSource" DataTextField="Name" DataValueField="Name" Width="240px">
                </asp:ListBox>
                <asp:ObjectDataSource ID="GroupsDataSource" runat="server" 
                  OldValuesParameterFormatString="original_{0}" SelectMethod="GetGroups" 
                  TypeName="Library.DomainGroup" onselected="GroupsDataSource_Selected">
                </asp:ObjectDataSource>
              </ContentTemplate>
            </asp:UpdatePanel>
            <br />
            <br />
            <asp:UpdatePanel ID="InRoleUpdatePanel" runat="server" UpdateMode="Conditional" RenderMode="Inline">
              <ContentTemplate>
                &nbsp;&nbsp;
                <asp:Button ID="InRoleButton" runat="server" Text="ネストした全所属グループの表示" Width="210px" TabIndex="31" Enabled="False" Height="27px" />
              </ContentTemplate>
            </asp:UpdatePanel>
            <br />
            <br />
            <asp:UpdatePanel ID="MemberUpdatePanel" runat="server" UpdateMode="Conditional" RenderMode="Inline">
              <ContentTemplate>
                &nbsp;&nbsp;
                <asp:Button ID="MemberButton" runat="server" Text="ネストした全メンバーの表示" Width="210px" TabIndex="32" Enabled="False" Height="27px" />
              </ContentTemplate>
            </asp:UpdatePanel>
          </td>
          <td>
          </td>
          <td valign="top">
            <asp:UpdatePanel ID="DetailUpdatePanel" runat="server" UpdateMode="Conditional" RenderMode="Inline">
              <ContentTemplate>
                <asp:FormView ID="DetailFormView" runat="server" DataSourceID="DetailDataSource" Width="550px">
                  <ItemTemplate>
                    <table>
                      <tr>
                        <td valign="top">説明</td>
                        <td valign="top" style="height:50px">
                          <asp:TextBox ID="DescriptionTextBox" runat="server" TabIndex="11" MaxLength="256" 
                            Width="500px" Height="40px" TextMode="MultiLine" Text='<%# Bind("Description") %>'>
                          </asp:TextBox>
                        </td>
                      </tr>
                      <tr style="height:25px">
                        <td colspan="2">グループのスコープ&nbsp;&nbsp;
                          <asp:Label ID="ScopeLabel" runat="server" Width="160px" Text='<%# Eval("Scope") %>'></asp:Label>
                          グループの種類&nbsp;&nbsp;
                          <asp:Label ID="TypeLabel" runat="server" Text='<%# Eval("Type") %>'></asp:Label>
                        </td>
                      </tr>
                      <tr style="height:25px">
                        <td colspan="2">所属パス&nbsp;&nbsp;
                          <asp:Label ID="DisplayPathLabel" runat="server" Text='<%# Eval("DisplayPath") %>'></asp:Label>
                        </td>
                      </tr>
                    </table>
                  </ItemTemplate>
                  <EmptyDataTemplate>
                    <asp:Literal ID="Literal1" runat="server" Text="一覧からグループを選択してください。" EnableViewState="False"></asp:Literal>
                  </EmptyDataTemplate>
                </asp:FormView>
                <asp:ObjectDataSource ID="DetailDataSource" runat="server" 
                  OldValuesParameterFormatString="original_{0}" SelectMethod="FindByName" 
                  TypeName="Library.DomainGroup" onselected="DetailDataSource_Selected" 
                  onselecting="DetailDataSource_Selecting">
                  <SelectParameters>
                    <asp:ControlParameter ControlID="GroupListBox" Name="name" PropertyName="SelectedValue" Type="String" />
                  </SelectParameters>
                </asp:ObjectDataSource>
                <asp:Panel ID="RelatingPanel" runat="server" Visible="False" Width="560px">
                  <table>
                    <tr>
                      <td valign="top">メンバー</td>
                      <td>
                        <asp:GridView ID="MemberGridView" runat="server" AutoGenerateColumns="False" 
                          TabIndex="12">
                          <Columns>
                            <asp:BoundField ConvertEmptyStringToNull="False" HeaderText="名前" ReadOnly="True" DataField="Name" >
                            <HeaderStyle BackColor="#FFFFCC" />
                            <ItemStyle Width="260px" Wrap="True" />
                            </asp:BoundField>
                            <asp:BoundField ConvertEmptyStringToNull="False" HeaderText="パス" ReadOnly="True" DataField="Path" >
                            <HeaderStyle BackColor="#FFFFCC" />
                            <ItemStyle Width="200px" Wrap="True" />
                            </asp:BoundField>
                          </Columns>
                          <EmptyDataTemplate>
                            <asp:Literal ID="Literal2" runat="server" Text="なし" EnableViewState="False"></asp:Literal>
                          </EmptyDataTemplate>
                          <EmptyDataRowStyle BackColor="#FFFFCC" />
                        </asp:GridView>
                      </td>
                    </tr>
                    <tr>
                      <td valign="top" style="width:70px">所属する　グループ</td>
                      <td>
                        <asp:GridView ID="GroupGridView" runat="server" AutoGenerateColumns="False" TabIndex="13">
                          <Columns>
                            <asp:BoundField ConvertEmptyStringToNull="False" DataField="Name" 
                              HeaderText="名前" ReadOnly="True">
                            <HeaderStyle BackColor="#FFFFCC" />
                            <ItemStyle Width="260px" Wrap="False" />
                            </asp:BoundField>
                            <asp:BoundField ConvertEmptyStringToNull="False" DataField="Path" 
                              HeaderText="パス" ReadOnly="True">
                            <HeaderStyle BackColor="#FFFFCC" />
                            <ItemStyle Width="200px" Wrap="False" />
                            </asp:BoundField>
                          </Columns>
                          <EmptyDataTemplate>
                            <asp:Literal ID="Literal3" runat="server" Text="なし" EnableViewState="False"></asp:Literal>
                          </EmptyDataTemplate>
                          <EmptyDataRowStyle BackColor="#FFFFCC" />
                        </asp:GridView>
                      </td>
                    </tr>
                  </table>
                </asp:Panel>
              </ContentTemplate>
              <Triggers>
                <asp:AsyncPostBackTrigger ControlID="GroupListBox" EventName="SelectedIndexChanged" />
              </Triggers>
            </asp:UpdatePanel>
          </td>
        </tr>
      </table>
      <br />
      <asp:Button ID="Button1" runat="server" Text="戻る" TabIndex="51" onclick="Button1_Click" />
    </div>
    </form>
</body>
</html>
